/*
 * threads.h
 *
 *  Created on: 10.01.2013
 *      Author: Michael
 */

#ifndef THREADS_H_
#define THREADS_H_

#include <inttypes.h>
#include <setjmp.h>

/* First thread run method */
void runThread1(void);

/* Second thread run method */
void runThread2(void);

/* Display an LED lighting sequence to indicate power on.
 * Only possible with C5000 Audiobooster pack attached
*/
void runThread3(void);

typedef enum {
	THREAD_INVALID,
	THREAD_RUNNING,
	THREAD_READY
} State_t;

typedef struct {
	uint16_t id;
	State_t state;
	jmp_buf context;
	void (*run)(void);
} Thread_t;


/* Create thread 1 */
Thread_t createThread1(uint16_t id);

/* Create thread 2 */
Thread_t createThread2(uint16_t id);

/* Create thread 3 */
Thread_t createThread3(uint16_t id);

#endif /* THREADS_H_ */
